package it.patterns.structural.decorator;

/**
 * Attach additional responsibilities to an object dynamically. Decorators
 * provide a flexible alternative to subclassing for extending functionality.
 * 
 * Decorators forward requests to its Component object. It may optional perform
 * additional operations before or after forwarding the request.
 * 
 * The decorators are transparent to the Components.
 * 
 * <img src="Decorator.jpg" alt="Pattern Structure"/>
 * 
 * @author Luca D'Onofrio
 * 
 * @category Structural Pattern
 * @see "Design Patterns - Element of Reusable Object Oriented Software (Gamma,Helm, Johnson, Vlissides)"
 * 
 * @version 1.0
 */
public abstract class Decorator implements Component {
	protected Component component;

	public Decorator(Component component) {
		super();
		this.component = component;
	}

	@Override
	public String operation() {
		return component.operation();
	}
}
